
const commonConfig = require('./webpack.common.js')
const { merge } = require('webpack-merge')
const webpack = require('webpack')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = merge(commonConfig, {
    mode: 'development',
    devtool: "source-map",
    plugins: [
        new VueLoaderPlugin(),
        new webpack.DefinePlugin({
            BASE_URL: '"./"',
        }),
        new HtmlWebpackPlugin({
            title: 'my webpack demo',
            template: './public/index.html',
            cache: false
        }),
        new webpack.HotModuleReplacementPlugin(),
    ],
    watchOptions: {
        ignored: /node_modules/,
    },
    devServer: {
        hot: true,
        watchContentBase: true,
        contentBase: [
            path.join(__dirname, 'public'),
        ],
        port: 9000,
    }
})
